import pygame,sys,random,time
pygame.init()
c1=1000
c2=1000
c3=5
c4=1
c5=100
screen=pygame.display.set_mode([1000,1000])#大小
screen.fill([255,255,255])
pygame.display.flip()
def a(c1,c2,c3,c4,c5):
    for i in range(c5):
        x=random.randint(0,10)
        if x<4:
            pygame.draw.rect(screen,[random.randint(0,255),random.randint(0,255),random.randint(0,255)],[random.randint(0,c1-c1/5),random.randint(0,c2-c2/5),random.randint(1,c1/2),random.randint(1,c2/2)],random.randint(c4,c3))
        if x>3 and x<7:
            pygame.draw.circle(screen,[random.randint(0,255),random.randint(0,255),random.randint(0,255)],[random.randint(0,c1-c1/5),random.randint(0,c2-c2/5)],random.randint(1,(c1+c2)/5),random.randint(c4,c3))
        if x>6:
            pygame.draw.ellipse(screen, [random.randint(0,255),random.randint(0,255),random.randint(0,255)], [random.randint(0,c1-c1/5),random.randint(0,c2-c2/5),random.randint(1,c1/2),random.randint(1,c2/2)],random.randint(c4,c3) )
    pygame.display.flip()

run=True
while run:
    pygame.draw.rect(screen,[255,255,255],[-100,-100,2000,2000],0)
    a(c1,c2,c3,c4,c5)
    c5+=1
    time.sleep(1)
    for event in pygame.event.get():
        if event.type==pygame.QUIT:
            run=False


pygame.quit()
#image.png